package com.zuipin.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zuipin.entity.product.ProductIntervalPrice;
import com.zuipin.mapper.ProductIntervalPriceMapper;
import com.zuipin.service.IProductIntervalPriceService;

/**
 * 商品价格区间业务类实现
 *
 * @ClassName ProductIntervalPriceServiceImpl
 * @author wangcongyi
 * @date 2017年5月2日 上午10:48:05
 */
@Service
public class ProductIntervalPriceServiceImpl implements IProductIntervalPriceService {

	@Resource
	private ProductIntervalPriceMapper productIntervalPriceMapper;

	@Override
	public ProductIntervalPrice selectById(Long id) {
		// TODO Auto-generated method stub
		return productIntervalPriceMapper.selectByPrimaryKey(id);
	}

	@Override
	public int insertSelective(ProductIntervalPrice record) {
		// TODO Auto-generated method stub
		return productIntervalPriceMapper.insertSelective(record);
	}

	@Override
	public int updateByPrimaryKeySelective(ProductIntervalPrice record) {
		// TODO Auto-generated method stub
		return productIntervalPriceMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int deleteByPrimaryKey(Long id) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int insert(ProductIntervalPrice record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateByPrimaryKey(ProductIntervalPrice record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Transactional(rollbackFor = Exception.class)
	@Override
	public int insertBatch(List<ProductIntervalPrice> record) {
		// TODO Auto-generated method stub
		return productIntervalPriceMapper.insertBatch(record);
	}

	@Transactional(rollbackFor = Exception.class)
	@Override
	public int deleteByProExtId(Long proExtId){
		// TODO Auto-generated method stub
		return productIntervalPriceMapper.deleteByProExt(proExtId);
	}

}
